<template >
  <div class="base-button" @click="onClick">
    1-这是一个按钮组件，点击 - {{ count }}
  </div>
</template>

<script>
import {defineComponent, ref, onMounted, reactive, watch, getCurrentInstance} from "vue";
  export default defineComponent({
    name: "Button",
    components: {
    },
    props: {

    },
    setup(props, {attrs, slots, emit}) {
      let count = ref(1)
      const onClick = (e) => {
        count.value++
        console.log(count.value, 'count值')
      }

      return {
        onClick,
        count,
      }
    }
  });
</script>

<style>
.base-button {
  margin: 0 auto;
  width: 300px;
  height: 60px;
  line-height: 60px;
  background: #000;
  color: #fff;
  border-radius: 10px;
}
</style>
